export default function (apis) {
  return function (target) {
    const boundApis = {};
    for (const api of Object.keys(apis)) {
      boundApis[api] = async function () {
        try {
          return await apis[api].call(target, ...arguments);
        } catch (e) {
          return {};
        }
      };
    }
    return boundApis;
  };
}
